<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<LINK rel="Bookmark" href="/Public/favicon.ico" >
<LINK rel="Shortcut Icon" href="/Public/favicon.ico" />
<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<script type="text/javascript" src="lib/PIE_IE678.js"></script>
<![endif]-->
<link href="/Public/static/h-ui/css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="/Public/static/h-ui.admin/css/H-ui.admin.css" rel="stylesheet" type="text/css" />
<link href="/Public/lib/Hui-iconfont/1.0.7/iconfont.css" rel="stylesheet" type="text/css" />
<link href="/Public/css/style.css" rel="stylesheet" type="text/css" />
<script src="/Public/laydate/laydate.js"></script>
<link rel="stylesheet" type="text/css" href="/Public/css/jquery.editable-select.min.css" />

<!--[if IE 6]>
<script type="text/javascript" src="http://lib.h-ui.net/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title>建档</title>
</head>
<body>

<form class="form form-horizontal" action="" id="form-consump-add" method="post">
<table class="table table-border table-bordered table-bg jd" style="width:95%; margin:20px auto;">
  <!--建档-->
  <tr>
    <td width="120">贷款人信息</td>
    <td>
    <ul>
    <li> 贷款人姓名<input type="text" name="client_name" id="client_name" value="" class="input-text kk" style=" width:120px"></li>
    <li>身份证号<input type="text" name="card" id="card"  value="" class="input-text kk" style=" width:180px;"></li>
    <li>建档时间<input class="input-text kk" onClick="laydate()" name="create_time" id="create_time"  value="" style=" width:100px"></li>
    <li>手机号码<input type="text" name="phone" id="phone"  value="" class="input-text kk" style=" width:120px"></li>
    <li>固定电话<input type="text" name="tel" id="tel"   value="" class="input-text kk" style=" width:120px"></li>
    <li>工作单位<input type="text" name="work" id="work"  value="" class="input-text kk" style=" width:240px;"></li>
    <li>单位电话<input type="text" name="work_tel" id="work_tel"  value="" class="input-text kk" style=" width:120px"></li>
    </ul>
    </td>
  </tr>
  <tr>
    <td>贷款信息</td>
    <td>
    <ul>
    <li>贷款金额<input type="text" name="loan_amount" id="loan_amount"  value="" class="input-text kk" style=" width:100px">万元</li>
    <li>贷款年限<input type="text" name="loan_year" id="loan_year"  value="" class="input-text kk" style=" width:100px">年</li>
		<li>贷款银行（总行）
			<select name="bank_id" class="select2 kk bank-zong">
				<option >请选择总行</option>
	      <?php if(is_array($banks)): $i = 0; $__LIST__ = $banks;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$banks): $mod = ($i % 2 );++$i;?><option value="<?php echo ($banks["bank_id"]); ?>"><?php echo ($banks["bank_name"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
    	</select>
		</li>
		<li>贷款银行（支行）
			<select name="part_bank_id" class="select2 kk bank-zhi" style="width:120px">
	      <option>请先选择总行</option>
    	</select>
		</li>

     <li>推荐人
         <select name="referrer_id" id="editable-select" class="form-control select2 kk"  style=" width:200px;display:inline"  >
             <option>请选择</option>
             <?php if(is_array($users)): $i = 0; $__LIST__ = $users;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$u): $mod = ($i % 2 );++$i;?><option value="<?php echo ($u["user_id"]); ?>"><?php echo ($u["user_name"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
         </select>
     </li>
    </ul>
     <ul>
    <li>品种
    <input name="loan_type" type="radio" value="1" class="kk">信用贷
    <input name="loan_type" type="radio" value="2" class="kk">消费贷
    <input name="loan_type" type="radio" value="3" class="kk">企业贷
    </li>
   </ul>
	 <ul>
		 <li>送审时间：<input type="text" name="send_time"  onClick="laydate()" value="" class="input-text kk" style=" width:200px"></li>
		 <li>实际审核完成时间：<input type="text" name="finish_time"  onClick="laydate()" value="" class="input-text kk" style=" width:200px"></li>
	 </ul>
     <ul>
    <li><textarea name="remark" cols="" rows="" class="textarea"  placeholder="请填写备注" style="width:600px;"></textarea></li>
    </ul>
    </td>
  </tr>
  <tr>
    <td>房屋信息</td>
    <td>
    <ul>
    <li>地址<input type="text" name="house_addresss" id="house_addresss"  value="" class="input-text kk" style=" width:400px"></li>
    </ul>
    <ul>
    <li>抵押日期<input class="input-text kk" onClick="laydate()" name="mortgage_time" id="mortgage_time" value="" style=" width:100px"></li>

    <li>下款日期<input class="input-text kk" onClick="laydate()" name="credit_time" id="credit_time" value="" style=" width:100px"></li>
    </ul>
    </td>
  </tr>
  <tr>
  <td colspan="2" style="text-align:center"><input type="submit" value="保存"  class="btn btn-danger radius"></td>
  </tr>

 </table>
</form>



<script type="text/javascript" src="/Public/lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="/Public/lib/layer/2.1/layer.js"></script>
<script type="text/javascript" src="/Public/css/jquery.editable-select.min.js"></script>

<script type="text/javascript">
$('#editable-select').editableSelect({
	effects: 'slide'
});
$('#html').editableSelect();
$('#editable-select').editableSelect({
    onSelect: function (element) {
        alert("Selected!");
    }
});
</script>
<script type="text/javascript">
$('.bank-zong').change(function(){
    var id = $('select[name="bank_id"]').val();
    $.ajax({
        type:'post',
        url:"<?php echo U('Index/zhi');?>",
        data:{id:id},
        dataType:'json',
        success:function(json){
            console.log(json);
            $('.bank-zhi').empty();
            $('.bank-zhi').append('<option value="">请选择支行</option>')
            var len=json.length;
            for(i = 0;i <= len;i++){
                $('.bank-zhi').append('<option value='+json[i]['bank_id']+'>'+json[i]['bank_name']+'</option>')
            }
        }
    })
})
var index = parent.layer.getFrameIndex(window.name)
$("#form-consump-add").submit(function(){
$(".radius").attr('type','button');
        $.ajax({
          url:'<?php echo U('Consump/creatconsumption');?>',
          type:'post',
          data:$('#form-consump-add').serialize(),
          dataType:'json',
          success:function(data){
            if(data.ResultCode == '200'){
              layer.msg(data.ResultMessage,{time:1000},function(){
                  parent.window.location.reload()
                  parent.layer.close(index);
              });
            }
            else if(data.ResultCode == '500'){
                layer.msg(data.ResultMessage,{time:1000},function(){

                })
            }
          }
        })
        return false;
	});
</script>
</body>
</html>